#!/bin/bash

echo "==================================================================="
echo "连接关系功能测试演示"
echo "==================================================================="
echo ""

echo "1. 显示顶层模块的所有端口到子模块的连接关系："
echo "-------------------------------------------------------------------"
./moparse -i test_connection.modb -m top_module --show-connect-top2sub
echo ""

echo "2. 只显示与特定子模块 u_sub_a 的连接关系："
echo "-------------------------------------------------------------------"
./moparse -i test_connection.modb -m top_module --show-connect-top2sub -s u_sub_a
echo ""

echo "3. 显示两个子模块 u_sub_a 和 u_sub_b 之间的连接关系："
echo "-------------------------------------------------------------------"
./moparse -i test_connection.modb -m top_module --show-connect-sub2sub -sa u_sub_a -sb u_sub_b
echo ""

echo "4. 使用流水线示例显示更复杂的连接（3个子模块）："
echo "-------------------------------------------------------------------"
echo "4.1 顶层模块到所有子模块的连接："
./moparse -i test_pipeline.modb -m top_module --show-connect-top2sub
echo ""

echo "4.2 子模块 u_sub_a 到 u_sub_b 的连接："
./moparse -i test_pipeline.modb -m top_module --show-connect-sub2sub -sa u_sub_a -sb u_sub_b
echo ""

echo "4.3 子模块 u_sub_b 到 u_sub_c 的连接："
./moparse -i test_pipeline.modb -m top_module --show-connect-sub2sub -sa u_sub_b -sb u_sub_c
echo ""

echo "==================================================================="
echo "演示完成！"
echo "==================================================================="
